*Replication Code for Fraga and Miller 2021 JOP. "Who Does Voter ID Keep from Voting?"
*This code replicates individual-level analysis of cited reasons for RID filing in the paper.
*This analysis is found in Figures 2, 3, A1, A2
*And Tables A5, A6, 


*Load replication file
use fraga_miller_reasons_replication.dta, clear

*Install schemes
net install gr0002_3, from(http://www.stata-journal.com/software/sj4-3)

*Tidy Up
set scheme lean1
graph set window fontface "Times New Roman"

***FIGURES

*Draw Figure 2: Impediments Cited by Texas Voters in 2016
graph hbar family  applied transport birthcert  disability work lost other,  ascat legend(off) yvaroptions(relabel(1 "Family Obligations" 2 "Applied, Has Not Received" 3 "Lack of Transportation" 4 "Lacks Necessary Documents"  5 "Disability/Illness" 6 "Work Obligations" 7 "ID was Lost or Stolen" 8 "Other Reason"))  intensity(*1.1) ytitle("Percent")
graph export "Other_Bar.png", as(png) replace

*Draw Figure 3: Binned Impediments Cited
graph hbar relocation hardship id_capable, ascat bar(1, bcolor(black)) bar(3, fcolor(white) lcolor(black) lwidth(med)) legend(off) yvaroptions(relabel(1 "Relocation" 2 "Hardship" 3 "ID-Capable")) intensity(*1.1) ytitle("Percent")
graph export "Binned_Bar.png", as(png) replace

*Draw Figure A1: Impediments Cited by Texas Voters in 2016, by Race
graph hbar family  applied transport birthcert  disability work lost other if race==1|race==2|race==3, over(race) ascat legend(off) yvaroptions(relabel(1 "Family Obligations" 2 "Applied, Has Not Received" 3 "Lack of Transportation" 4 "Lacks Necessary Documents"  5 "Disability/Illness" 6 "Work Obligations" 7 "ID was Lost or Stolen" 8 "Other Reason"))  intensity(*1.1) ytitle("Percent")
graph export "Other_Bar_by_race.png", as(png) replace

*Draw Figure A2: Impediments Cited by Texas Voters in 2016, by Race
graph hbar relocation hardship id_capable if race==1|race==2|race==3, over(race) ascat bar(1, bcolor(black)) bar(3, fcolor(white) lcolor(black) lwidth(med)) legend(off) yvaroptions(relabel(1 "Relocation" 2 "Hardship" 3 "ID-Capable")) intensity(*1.1) ytitle("Percent")
graph export "Binned_Bar_by_race.png", as(png) replace

*Figure A3: Non-Photo ID Presented at the Polls
graph hbar vote_cert bc2 utility2 bank2 govcheck2 other_id,  ascat legend(off) yvaroptions(relabel(1 "Voter Certificate" 2 "Birth Certificate" 3 "Utility Bill" 4 "Bank Statement"  5 "Govt. Check" 6 "Other"))  intensity(*1.1) ytitle("Percent")


***SUPPLEMENTAL MODELS

*Table A5: Determinants of Choosing Various RID Categories
*This loop runs each model in Table A5 from left to right, sequentially.
foreach i of varlist transport- applied {
logit `i' age age_sq female black-other_race, cluster(county)
 }

 
 *Table A6: Determinants of Falling into Binned Categories
 *This loop runs each model in Table A6 from left to right, sequentially.
 foreach i of varlist relocation hardship id_capable  {
logit `i' age age_sq female black-other_race, cluster(county)
 }
 
 *Table A7 : Seemingly Unrelated Linear Probability Regression Coefficients: Determinants of Choosing Various RID Categories
 #delimit ;
 sureg 
 (transport age age_sq female black-other_race) 
 (birthcert age age_sq female black-other_race) 
 (work age age_sq female black-other_race) 
 (lost age age_sq female black-other_race) 
 (disability age age_sq female black-other_race) 
 (family age age_sq female black-other_race) 
 (applied age age_sq female black-other_race) 
 ;
  #delimit cr
 
 *Table A8 : Seemingly Unrelated Linear Probability Regression Coefficients: Determinants of Falling into Binned Categories
  #delimit ;
  sureg
 (relocation age age_sq female black-other_race) 
 (hardship age age_sq female black-other_race) 
 (id_capable age age_sq female black-other_race) 
 ; 
 #delimit cr
 


